#!/bin/sh
# This regression test is a part of SIPp.
# A setdest over -t sn: each call's new association comes up as one to
# the remote host given does, and the calls get through.
. "`dirname "$0"`/../functions"; init

"`get_sipp`" -v | grep -q SCTP || skip "no SCTP"
perl -e 'use Socket; socket(S, PF_INET, SOCK_STREAM, 132) || exit 1' ||
    skip "no SCTP sockets"

sippbg -sn uas -t s1 -i 127.0.0.1 -p 28042 -m 2 -timeout 5
# Nothing listens on 28040: setdest sends the calls to 28042.
sippfg -sf uac.xml -t sn -i 127.0.0.1 -p 28041 127.0.0.1:28040 \
    -m 2 -r 10 -timeout 4 >/dev/null 2>&1
status=$?
test $status -eq 0 || fail "the UAC exited with $status"
ok
